<?php

namespace app\web\model;

use app\common\model\Bank;
use think\Model;

class BankWeb extends Model
{
    protected $table = 'sc_bank';

    public function lists($page_conf)
    {
        $data = $this->field('id,bank_name,logo,bonus_total,hotspot,tips,bonus_one,bonus_two,bonus_three')
            ->where('status', Bank::BANK_ON)
            ->order('sort desc')
            ->paginate($page_conf);
        if($data) {
            foreach($data as $value) {
                $value['detail_url'] = env('API_HOST').url('bank/detail',['id'=> $value['id']]);
            }
        }
        return $data;
    }
}
